﻿using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour {
	public GameObject cameraObj;

	//we assume at the start of the game, we'll always be at the most left of the game Scene
	//so at the beginning, camera sure won't follow character
	public bool isFollowingCharacter=false;

	// Use this for initialization
	void Start () {
	
	}

	void FixedUpdate() {


		if(isFollowingCharacter){
			Vector3 newCameraPos = cameraObj.transform.position;
			newCameraPos.x = transform.position.x;
			cameraObj.transform.position = newCameraPos;
		}
	}

	// Update is called once per frame
	void Update () {
	
	}
}
